package com.zhentao.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhentao.domain.SysBattery;
import com.zhentao.domain.vo.Result;
import com.zhentao.service.SysBatteryService;
import com.zhentao.mapper.SysBatteryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 86133
* @description 针对表【sys_battery】的数据库操作Service实现
* @createDate 2024-08-27 21:33:19
*/
@Service
public class SysBatteryServiceImpl extends ServiceImpl<SysBatteryMapper, SysBattery>
    implements SysBatteryService{
    @Autowired
    private SysBatteryMapper sysBatteryMapper;

    @Override
    public Result<List<SysBattery>> getBatteryList(Integer byid) {
        List<SysBattery> list = this.list(Wrappers.<SysBattery>lambdaQuery().eq(SysBattery::getBatteryType, byid));
        return Result.build(list,200,"查询成功");
    }
    //查询所有电池及类型
    @Override
    public Result<List<SysBattery>> getBatteryList() {
        List<SysBattery> batteryList = sysBatteryMapper.getBatteryList();
        return Result.build(batteryList,200,"查询成功");
    }
}




